<template>
	<view class="bg-gradient-to-b from-[#F2F8FF] p-20 to-[#D0EDFF] rounded-lg">
		<template v-if="isAch == 1">
			<view class="flex items-center mb-20">
				<view class="flex items-center">
					<text class="font-bold text-sm">LV.</text>
					<text class="text-[#329EFF] font-bold text-sm ml-10">{{anchor.achorlevel?.lev}}</text>
				</view>
				<view class="flex-1 mx-20 border-2 border-solid border-white rounded-full overflow-hidden bg-[#EEF1F6]">
					<view class="bg-gradient-to-r h-20 rounded-r-full"
						:style="{width:`${lessonCount(anchor.exp,anchor.achorlevel?.upcost)}%`,'--tw-gradient-stops':`#82CAFF,#329EFF`}">
					</view>
				</view>
				<text class="text-[#3E5D73] text-sm">{{anchor.exp}}/{{anchor.achorlevel?.upcost}}</text>
			</view>
			<!-- 主播收益 -->
			<view class="flex items-center">
				<view class="bg-[#BBE4FF] p-10 rounded-md flex items-center flex-1">
					<text class="text-[#3A5970] font-bold">今日收益</text>
					<view class="bg-white flex-1 ml-4 rounded-full h-48 flex items-center px-20">
						<view class="flex-1 flex items-center">
							<ImageBoxVue src="/static/icons/red.png" width="28rpx" height="29rpx"></ImageBoxVue>
							<text class="ml-10">{{anchor.todayred}}钻</text>
						</view>
						<view class="flex-1 flex items-center">
							<ImageBoxVue src="/static/icons/blue.png" width="28rpx" height="29rpx"></ImageBoxVue>
							<text class="ml-10">{{anchor.todayblue}}钻</text>
						</view>
					</view>
				</view>
				<view class="flex ml-20">
					<view class="border-[#3B9BDC] border border-solid rounded-full py-6 px-20" @click="onPath(`/pages/user/aptitude?view=true&id=${anchor.id}`)">
						<text class="text-[#3B9BDC]">TA的资质</text>
					</view>
				</view>
			</view>
		</template>
		<template v-else>
			<view class="flex items-center mb-20" v-if="val.openlev == 1">
				<view class="flex items-center">
					<text class="font-bold text-sm">LV.</text>
					<text class="text-[#329EFF] font-bold text-sm ml-10">{{val.memberlevel?.lev}}</text>
				</view>
				<view class="flex-1 mx-20 border-2 border-solid border-white rounded-full overflow-hidden bg-[#EEF1F6]">
					<view class="bg-gradient-to-r h-20 rounded-r-full"
						:style="{width:`${lessonCount(val.exp,val.memberlevel?.nedexp)}%`,'--tw-gradient-stops':`#82CAFF,#329EFF`}">
					</view>
				</view>
				<text class="text-[#3E5D73] text-sm">{{val.exp}}/{{val.memberlevel?.nedexp}}</text>
			</view>
			<!-- 用户收益 -->
			<view>
				<view class="">
					<view class="bg-[#BBE4FF] p-10 rounded-md flex flex-1 items-center mb-10">
						<text class="text-[#3A5970] font-bold">今日收益</text>
						<view class="bg-white flex-1 ml-4 rounded-full h-48 flex justify-center items-center px-20">
							<view class="flex-1 flex items-center">
								<ImageBoxVue src="/static/icons/red.png" width="28rpx" height="29rpx"></ImageBoxVue>
								<text class="ml-10">{{val.tred}}钻</text>
							</view>
							<view class="flex-1 flex items-center">
								<ImageBoxVue src="/static/icons/blue.png" width="28rpx" height="29rpx"></ImageBoxVue>
								<text class="ml-10">{{val.tblue}}钻</text>
							</view>
						</view>
					</view>
				</view>
				<!-- <view class="flex justify-center">
					<text class="font-bold text-[#3B9BDC]">收益比例{{val.incomeRatio}}</text>
				</view>
				<view class="bg-[#EBF7FF] p-10 flex flex-col rounded-lg">
					<view class="indent-100">
						<text class="text-[#697379]">{{text}}</text>
					</view>
					<view class="">
						<text class="text-[#FF7134] font-bold">【注】</text>
						<text class="text-[#697379]">{{text1}}</text>
					</view>
				</view> -->
			</view>
		</template>
	</view>
</template>

<script setup>
	const {
		val,
		anchor,
		isAch
	} = defineProps(['val', 'anchor', 'isAch'])
	
	const lessonCount = (num, num1) => {
		return ((num / num1) * 100).toFixed(2)
	}
	const onPath = (router) => {
		uni.navigateTo({
			url: router
		})
	}
</script>

<style>
</style>